Field of the Invention
The present invention relates to a communication apparatus having a plurality of communication interfaces and a method of controlling the same.
Description of the Related Art
In recent years, wireless LAN systems as typified by IEEE 802.11 have been widely used. In wireless LAN systems, an infrastructure mode in which communication is performed via an access point (hereinafter referred to as an AP) that manages a wireless network is typically used. Meanwhile, a technique by which it is possible to implement peer-to-peer communication (hereinafter referred to as P2P communication) that does not go through an intermediary apparatus such as an AP, using a connection configuration such as Wi-Fi Direct (WFD) established by the Wi-Fi Alliance is spreading. Also, there are communication apparatuses having a plurality of network interfaces such as an interface that performs communication in a wireless LAN infrastructure mode and an interface that performs P2P communication using a technique such as Wi-Fi Direct. In such a communication apparatus, it is possible to execute P2P communication by one network interface simultaneously to executing infrastructure mode communication in another network interface.
An infrastructure network is configured by an AP and a communication apparatus in an infrastructure mode. In the data communication in the infrastructure network, a routable address that is assigned by a DHCP server function that is built into the AP or a DHCP server in the LAN is typically used. DHCP means Dynamic Host Configuration Protocol. Meanwhile, in P2P communication, a P2P network is constructed using addresses decided between the communication apparatuses. In the case of communication using Wi-Fi Direct, IP communication on the P2P network is realized by the communication apparatus that became the group owner (GO) using a DHCP server function to assign an address to another communication apparatus. IP means Internet Protocol.
When the same network address is used in an infrastructure network and a P2P network, a communication apparatus having a plurality of network interfaces as described above cannot determine whether it should transmit a packet to the infrastructure network or to the P2P network. It is not desirable from a security perspective because, in addition to the communication using that packet failing when a packet is transmitted to an erroneous path, the packet flows over an erroneous path over which it should not have in fact flowed.
A technique for avoiding duplication of network addresses in an apparatus that has a plurality of network interfaces is disclosed in Japanese Patent Laid-Open No. 2015-130579 (hereinafter referred to as D1). According to D1, a communication apparatus for distributing addresses in a P2P network decides IP addresses so that there is no duplication of network addresses used in the infrastructure network, and distributes them to opposing apparatuses. By a method of addressing of D1, in a communication apparatus that is connected to a plurality of different networks, it becomes possible to use different IP addresses on respective networks, and it becomes possible to perform communication simultaneously by a plurality of networks.
However, there are cases in which a network address used in an infrastructure network is changed due to a setting of a DHCP server operating on the infrastructure network being changed, provision of an address being received from a different DHCP server, or the like. There is the possibility that when a network address that is used in an infrastructure network is changed in this way, it will become the same as a network address that is being used in the P2P network. If a network address used in the infrastructure network becomes the same as a network address being used in the P2P network, the communication apparatus is required to change the network address being used in the P2P network.
In the case of changing the network address of the P2P network, the communication apparatus must reset the IP address for the opposing apparatus belonging to the P2P network and its own interface that is connected to the P2P network. However, in the case that an address is distributed using a DHCP server function, so long as an address reobtainment request message does not arrive from the opposing apparatus operating as the DHCP client, the communication apparatus cannot notify the changed IP address to the opposing apparatus.